/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author Reynusa
 */
public class Database {
    public static Connection open() {
//        String url = "jdbc:oracle:thin:@localhost:1521:XE";
//        String name = "reynusa";
//        String pass = "reynusa";
        
        String url = "jdbc:oracle:thin:@172.23.9.185:1521:orcl";
        String name = "mhs125314075";
        String pass = "mhs125314075";
        Connection con = null;
        try {
            OracleDataSource ods = new OracleDataSource();
            ods.setURL(url);
            con = ods.getConnection(name, pass);
            Statement stat = con.createStatement();
            System.out.println("Connection OK");
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
        return con;
    }
}
